<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>销售管理</title>
    <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css"/>
	<script src="../../js/jquery3.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../css/nav_icon.css"/>
	<style type="text/css">
		body{
			overflow-y: hidden;
		}
        .layui-nav-tree{
            padding-top: 30px;
        }
        .layui-nav-tree .layui-nav-item a{
            font-size: 18px;
            height: 60px;
            line-height: 60px;
        }
        .layui-nav-tree .layui-nav-item dl a{
            font-size: 16px;
            height: 50px;
            line-height: 50px;
        }
	</style>
</head>

<body>
<div class="layui-layout">
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">目标管理</a>
                    <dl class="layui-nav-child">
                        <!-- <dd><a href="javascript:;" data-index="creat_target.html"><i
                                class="layui-icon layui-icon-add-1">新建目标</i> </a></dd> -->
                        <dd id="first"><a href="javascript:;" data-index="sales_target.html"><i class="iconfont icon-chanshengkangjingdianshiyanjilubiao"></i>我的目标</a></dd>
                        <dd><a href="javascript:;" data-index="archived.html"><i class="iconfont icon-renwuzuguanli"></i>已完成</a></dd>

                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" data-index="orders.html"><i class="iconfont icon-gongxuxinxibiao"></i>订单管理</a>
                </li>
                <li class="layui-nav-item" id="manage" style="display:none">
                    <a href="javascript:;" data-index="manage_products.html"><i class="iconfont icon-xitongguanli"></i>产品管理</a>
                </li>
                <li class="layui-nav-item" id="user" style="display:none">
                    <a href="javascript:;" data-index="user_products.html">产品列表</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-body" style="margin-left: -200px;">
        <!-- 内容主体区域 -->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show" style="height: 100%;">
                <iframe src="sales_target.html" frameborder="0" class="layadmin-iframe"
                        style="width: 100%;height: 100%;"></iframe>
                <script>
                    $("#first").addClass("layui-this")
                </script>
            </div>
        </div>
    </div>

</div>

<script src="../../layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script>

    $(function () {
        $.post("/user/getSelf", {}, function (data) {
            if (data.u_id != 0) {

                if (data.u_permission == "USER") {
                $("#user").css("display", "block")
            }
            if (data.u_permission == "ADMIN") {
                $("#manage").css("display", "block")
            }
        } else {
            alert("未登录，请先登录")
            location.href = "/html/login/login.html"
        }
        })
    })
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
        $(".layui-side a").each(function (index, el) {
            $(el).click(function () {
                $(".layui-body iframe").attr("src", $(this).attr("data-index"))
            })
        })
    });
</script>
</body>
</html>
